use(["public/javascripts/service/baseService.js"], function(BaseService) {
    var Login = {
        checkLogin: function(req, res, callback) {
            BaseService.checkUserLogin({headers: req.headers}, function(result) {
                if(result.errorCode == 401) {
                    res.redirect("/login?errorCode=401&redirectUrl=" + encodeURIComponent(req.url));
                } else {
                    callback();
                }
            });
        }
    }
    module.exports = Login;
});
